<template>
<div>
    <my-active-form
    :parameters="parameters" 
    handlerFn="get"
    @get="getArr"
    :parametersInfo="parametersInfo"></my-active-form>
    <div style="height:100px"></div>
    <el-button @click="getInfo()">查看</el-button>
</div>
    
</template>
<script>
import myActiveForm from './activeForm'
export default {
    components:{myActiveForm},
    data(){
        return{
            parameters:[],
            parametersInfo:{
                
            }
        }
    },
    mounted(){
        this.parameters = [
            {"code":1,"chinese":"111","name":"111","desc":"描述"},
            {"code":2,"chinese":"222","name":"222","desc":"描述"},
            {"code":3,"chinese":"333","name":"333","desc":"描述"},
            {"code":4,"chinese":"444","name":"444","desc":"描述"},
        ]
        this.parameters.forEach(v=>{
            v.show = true;
        })
    },
    methods:{
        getArr(arr){
            // console.log(arr)
        },
        getInfo(){
            console.log('look')
            this.parametersInfo = [
                    {id:1,config_id:1,name:'只见周期',chinese:"质检周期",c:2,v:'10'},
                    {id:1,config_id:1,name:'只见周期',chinese:"质检周期",c:3,v:'10'},
                ]
            let arr = [];
            this.parameters.forEach(v=>{
                this.parametersInfo.forEach(r=>{
                    if(r.c == v.code){
                        arr.push(r.c)
                    }
                })
            })
            this.parameters.forEach(v=>{
                if(arr.indexOf(v.code) > -1){
                    v.show = false
                    return
                }
                v.show = true
            })
        }
    }
}
</script>
